<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>属性监听</title>
        <script src="https://unpkg.com/vue@3.5.13"></script>
        <style>
            .blue {
                color: blue;
            }

            .red {
                color: red;
            }
        </style>
    </head>
    <body>
        <div id="app">
            <div :class="style">
                实例文案
            </div>
        </div>
        <script>
            const app = Vue.createApp({
                data() {
                    return {
                        style: {
                            blue: false,
                            red: true
                        }

                    }
                }
            })
            app.mount('#app')
        </script>
    </body>
</html>